package com.dongdongshop.controller;

import com.dongdongshop.data.Result;
import com.dongdongshop.service.ItemPageService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Component
@RocketMQMessageListener(topic = "goods-status",consumerGroup = "my-consumer-goods-status")
public class ItemPageController implements RocketMQListener<Long[]>{

    @Autowired
    private ItemPageService itemPageService;

    @Override
    public void onMessage(Long[] longs) {
        for (Long aLong : longs) {
            itemPageService.createItemPage(aLong);
        }
    }


  /*  public class createItemPage implements RocketMQListener<String> {
        @Override
        public void onMessage(String longs) {
            *//*for (Long aLong : longs) {
                itemPageService.createItemPage(aLong);
            }*//*

        }
        //暂时使用调用service生成静态页面

    }*/
}
